//
//  PlayUIView.h
//  CountDown2
//
//  Created by mmac on 11/9/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

@class PlayViewController;
@class CountDownProgressView;
@class CAAnimation;

@interface PlayUIView : UIView {
	PlayViewController *viewController;

	NSTimer *cdTimer;
	NSUInteger cdCount;
	NSUInteger cdCountTotal;
	
	CountDownProgressView *countDownProgressView;
	
	NSDictionary *levelData;
	CGRect levelBlocks[5];
	BOOL levelBlockHit[5];
	BOOL levelBlocksRight[5];
	
	BOOL _gameOver;
	BOOL _gameClear;
	BOOL _gameClearAnimation;
	
	CALayer *gameClearLayer;
}

@property (nonatomic, assign) PlayViewController *viewController;

- (id)initWithFrame:(CGRect)frame viewController:(PlayViewController *)aController levelData:(NSDictionary *)level;
- (void)setupSubviewsWithContentFrame:(CGRect)frameRect;
- (CGPoint)getFixedHitPoint:(CGPoint)point;


- (void)startTimer;
- (void)stopTimer;
- (void)cdTimerFireMethod:(NSTimer*)theTimer;
- (void)showCdCount;
- (void)prepareGameOver;
- (void)loadGameOver:(NSTimer*)theTimer;

- (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag;


@end
